package demo10;
/*
字符串的截取方法:
    public String substring(int index):截取从参数位置一直到结尾，返回新字符串
    public String substring(int begin,int end):截取从begin开始到end结束，[begin,end)*

 */
public class TestSubstring {
    public static void main(String[] args) {
        String str1 = "HelloWorld";
        String str2 = str1.substring(5);
        System.out.println("截取的字符串是："+str2);

        String str3 = str1.substring(1,7);
        System.out.println("截取的字符串是："+str3);
    }
}
